package at.chl.genetic.function.math.factory;

import at.chl.genetic.function.math.AbstractMathFunction;
import at.chl.genetic.function.math.AddFunction;
import at.chl.genetic.function.math.SubFunction;
import at.chl.genetic.function.math.ifstatement.IIfStatement;
import at.chl.genetic.function.math.node.ConstantNode;
import at.chl.genetic.function.math.node.FunctionNode;
import at.chl.genetic.function.math.node.ParamNode;
import at.chl.genetic.function.math.types.IfStatementType;
import at.chl.genetic.function.math.types.MathParamType;

public class MathNodeFactory {

	public static ConstantNode createConstantNode(long value) {
		ConstantNode node=new ConstantNode(value);
		return node;
	}

	public static ParamNode createParamNode(MathParamType type) {
		ParamNode node=new ParamNode(type);
		return node;
	}

	public static FunctionNode createAddNode() {
		AddFunction function=MathFunctionFactory.createAddFunction();
		FunctionNode node=new FunctionNode(function);
		return node;
	}

	public static FunctionNode createSubNode() {
		SubFunction function=MathFunctionFactory.createSubFunction();
		FunctionNode node=new FunctionNode(function);
		return node;
	}

	public static FunctionNode createIfBiggerNode() {
		IIfStatement statement=IfStatementType.BIGGER;
		AbstractMathFunction function=MathFunctionFactory.createIfFunction(statement);
		FunctionNode node=new FunctionNode(function);
		return node;
	}

	public static FunctionNode createIfLesserNode() {
		IIfStatement statement=IfStatementType.LESSER;
		AbstractMathFunction function=MathFunctionFactory.createIfFunction(statement);
		FunctionNode node=new FunctionNode(function);
		return node;
	}
	public static FunctionNode createIfEqualNode() {
		IIfStatement statement=IfStatementType.EQUAL;
		AbstractMathFunction function=MathFunctionFactory.createIfFunction(statement);
		FunctionNode node=new FunctionNode(function);
		return node;
	}

}
